@extends('_layouts.admin')

{{--页面标题--}}
@section('title')DashBoard @stop

{{--body样式追加--}}
@section('body-class')class="page-body"@stop

{{--body--}}
@section('body')
    @include('admin.doms.settings-pane')
    @include('admin.doms.copyright')
    <div class="page-container">
        @include('admin.doms.slider')
        <div class="main-content">
            @include('admin.doms.nav')
            <div class="page-title">
                <div class="title-env">
                    <h1 class="title">通知轴</h1>
                    <p class="description">展示通知, 查看各种来自系统或用户的通知</p>
                </div>
                <div class="breadcrumb-env">
                    <ol class="breadcrumb bc-1">
                        <li>
                            <a href="{{ url('/admin') }}"><i class="fa-home"></i>后台管理</a>
                        </li>
                        <li class="active">
                            <strong>消息中心</strong>
                        </li>
                    </ol>
                </div>
            </div>
            @if ($unread)
                <script>var unread = 1;</script>
                <button class="btn btn-info disabled">未读消息</button>
                <a href="{{ url('/admin/notify/all') }}"><button class="btn">全部消息</button></a>
            @else
                <script>var unread = 0;</script>
                <a href="{{ url('/admin/notify/unread') }}"><button class="btn">未读消息</button></a>
                <button class="btn btn-info disabled">全部消息</button>
            @endif
            <div class="timeline-centered">
                @if ($notifies)
                @foreach($notifies as $notify)
                <article class="timeline-entry @if($notify->not_id%2 == 0)left-aligned @endif">
                    <div class="timeline-entry-inner">
                        <time class="timeline-time"><span>{{ $notify->created_at }}</span></time>
                        <div class="timeline-icon timeline-bg-{{ $notify->s }}">
                            <i class="{{ $notify->i }}"></i>
                        </div>
                        <div class="timeline-label">
                            <h2><span>{{ $notify->t }}</span>
                                @if ($unread)
                                    <a href="javascript:;" class="pull-right">
                                        <i class="fa-remove" onclick="flag_one({{$notify->not_id}}, this)"></i>
                                    </a>
                                @endif
                            </h2>
                            <p>{{ $notify->content }}</p>
                        </div>
                    </div>
                </article>
                @endforeach
                <article class="timeline-entry begin">
                    <div class="timeline-entry-inner">
                        <div class="timeline-icon" style="cursor: pointer;" id="moreNotify" data-status="@if ($unread) 0 @else 1 @endif">
                            <i class="fa-ellipsis-v"></i>
                        </div>
                    </div>
                </article>
                @endif
            </div>
            @include('admin.doms.footer')
        </div>
    </div>
@stop

{{--底部JS--}}
@section('after-body')
    @parent
    <script src="{{ asset('assets/js/xenon-widgets.js') }}"></script>
    <script src="{{ asset('assets/js/toastr/toastr.min.js') }}"></script>
@stop